//如何控制连续
function fn(str){
    let word = str[0]; // 是否连续
    let count = 0;
    let maxCount = 0;
    
    let result = {}
    for (let i = 0; i < str.length; i++) {
        if(word === str[i]){
            count += 1 
            if(count > maxCount){ // 出现更大 更新结果
                result = {[str[i]]: count}
                maxCount = count
            }
            if(count == maxCount){ // 出现相同，添加元素
                result[str[i]] = count
            }
        } else {
            word = str[i]
            count = 1
        }
    }
    return result
}


console.log(fn('abbkejsbcccwqaaa'))